Update employee data (PUT)

This request is used to update information about a client's employee. There is a similar PATCH method.

Note

We strongly recommend not changing the employee's phone number. Instead, create a new employee.

Request syntax

PUT https://b2b-api.go.yandex.ru/integration/2.0/users?user_id={user ID}

Request headers

  • Authorization: Bearer <OAuth-token>
    OAuth access token. The steps to get a token are described in Getting started.
  • X-YaTaxi-Selected-Corp-Client-Id — client ID from the account. Required if multiple clients are available using the token.

Request parameters

The request contains the following required parameter:

  • user_id: the ID of the employee for whom the information is being updated.

Request body

Employee data is passed in the request body in JSON format:

Field Description Format Required
fullname The employee's full name. Can be an empty string. String Yes
phone The employee's phone number. String Yes
email The user's email. You can only specify an email that follows the standard address format. String No
is_active Indicates that the employee is active. An inactive employee can't place an order and rides can't be ordered in their name. Boolean Yes
cost_centers_id ID of the cost center settings, if the client has new cost centers. String Yes
is_deleted Indicates an archived employee. Boolean No
nickname The employee's short name. String No
department_id id of the employee's department in the interface of the Corporate Client Dashboard. String No
limits The limits on the amount the employee can spend on a specific service in a calendar month. An array of elements that contains a separate element for each service. No

Structure of the limits array element:

Field

Description

Format

Required

limit_id

The ID of a previously created limit. This ID will be assigned to a user.

String

Yes

service

The service name. Acceptable values:

  • taxi: Yandex Go;

  • eats2: Yandex Eats and Yandex Grocery;

  • grocery: Yandex Grocery;

  • drive: Car sharing;

  • tanker: Yandex Fuel;

  • cargo: Cargo transportation;

  • travel: Yandex Travel;

  • scooters: Yandex Scooters.

String

Yes

Response field description

Responses contain the following field:

Field Description Format
status If the request is successful, the status ОК is returned. String

Request example

PUT https://b2b-api.go.yandex.ru/integration/2.0/users?user_id=f65...c57d
...
Authorization: Bearer <OAuth token>

    {
        "fullname": "Ilya Ivanov",
        "phone": "+79990000000",
        "is_active": true,
        "nickname": "IIlya",
        "cost_centers_id": "123...fef",
        "department_id": "987...ghj",        
        "limits":[
            { 
                "limit_id": "abcdef_taxi",
                "service": "taxi" 
            },
            {
                "limit_id":"abcdef_eats",
                "service":"eats2"
            },
            {
                "limit_id":"abcdef_drive",
                "service":"drive"
            }
        ]   
     }

Response example

An example response to this request looks like this:

{
    "status": "OK"
}

Response codes

The response to this request may contain the following standard HTTP codes:

  • 200: Request completed successfully.

  • 400: An unknown parameter or a parameter with an invalid value was passed in the request.

  • 401: The OAuth token is incorrect.

  • 403: The client doesn't have sufficient rights to run this request:

    • SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header X-YaTaxi-Selected-Corp-Client-Id (returned if more than one client is available for the token).

    • SELECTED_CLIENT_ACCESS_DENIED: the header X-YaTaxi-Selected-Corp-Client-Id contains the client's ID, which this login does not have access to.

  • 404: The requested record wasn't found.

combined service

the service is outdated, use eats2

Hotels